Enable telemetry on SPARKY
[betaflight.git] / docs / development / Building in Windows.md
blobbb0f144f8e4e6d148057a41b1700043d660cbd2f
1 # Building in windows
4 ##Setup Cygwin
6 download the Setup*.exe from https://www.cygwin.com/
8 ![Cygwin Installation](assets/001.cygwin_dl.png)
10 Execute the download Setup and step through the installation  wizard (no need to customize the settings here). Stop at the  "Select Packages" Screen and select the following Packages
11 for Installation:
13 - Devel/git
14 - Devel/git-completion (Optional)
15 - Devel/make
16 - Devel/binutils
17 - Editors/vim    
18 - Editors/vim-common (Optional)
19 - Shells/mintty (should be already selected)
21 ![Cygwin Installation](assets/002.cygwin_setup.png)
23 ![Cygwin Installation](assets/003.cygwin_setup.png)
25 ![Cygwin Installation](assets/004.cygwin_setup.png)
27 ![Cygwin Installation](assets/005.cygwin_setup.png)
29 ![Cygwin Installation](assets/006.cygwin_setup.png)
32 Continue with the Installation and accept all autodetected dependencies.
34 ![Cygwin Installation](assets/007.cygwin_setup.png)
37 ##Setup GNU ARM Toolchain
39 ----------
41 versions do matter, 4.8-2014-q2 is known to work well. Download this version from https://launchpad.net/gcc-arm-embedded/+download - preferrebly as a ZIP-File. 
44 Extract the contents of this archive to any folder of your choice, for instance ```C:\dev\gcc-arm-none-eabi-4_8-2014q2```. 
46 ![GNU ARM Toolchain Setup](assets/008.toolchain.png)
48 add the "bin" subdirectory to the PATH Windows environment variable: ```%PATH%;C:\dev\gcc-arm-none-eabi-4_8-2014q2\bin```
50 ![GNU ARM Toolchain Setup](assets/009.toolchain_path.png)
52 ![GNU ARM Toolchain Setup](assets/010.toolchain_path.png)
54 ## Checkout and compile Cleanflight
56 Head over to the Cleanflight Github page and grab the URL of the GIT Repository: "https://github.com/cleanflight/cleanflight.git"
58 Open the Cygwin-Terminal, navigate to your development folder and use the git commandline to checkout the repository:
60 ```bash
61 cd /cygdrive/c/dev
62 git clone https://github.com/cleanflight/cleanflight.git
63 ```
64 ![GIT Checkout](assets/011.git_checkout.png)
66 ![GIT Checkout](assets/012.git_checkout.png)
68 To compile your Cleanflight binaries, enter the cleanflight directory and build the project using the make command. You can append TARGET=[HARDWARE] if you want to build anything other than the default NAZE target:
70 ```bash
71 cd cleanflight
72 make TARGET=NAZE
73 ```
75 ![GIT Checkout](assets/013.compile.png)
77 within few moments you should have your binary ready:
79 ```bash
80 (...)
81 arm-none-eabi-size ./obj/main/cleanflight_NAZE.elf
82    text    data     bss     dec     hex filename
83   95388     308   10980  106676   1a0b4 ./obj/main/cleanflight_NAZE.elf
84 arm-none-eabi-objcopy -O ihex --set-start 0x8000000 obj/main/cleanflight_NAZE.elf obj/cleanflight_NAZE.hex
85 ```
87 You can use the Cleanflight-Configurator to flash the ```obj/cleanflight_NAZE.hex``` file.
89 ## Updating and rebuilding
91 Navigate to the local cleanflight repository and use the following steps to pull the latest changes and rebuild your version of cleanflight:
93 ```bash
94 cd /cygdrive/c/dev/cleanflight
95 git reset --hard
96 git pull
97 make clean TARGET=NAZE
98 make
99 ```